home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-03 / qbasicpg.zip / BOUNDS.BAS < prev    next >
BASIC Source File  |  1989-08-31  |  981b  |  28 lines

  1. ' BOUNDS.BAS
  2. ' This program loads data into an array until QUIT is typed or
  3. '   the array boundaries are exceeded.
  4.  
  5. OPTION BASE 1               ' set array base to 1
  6. DIM party$(5)               ' dimension array with 5 elements
  7.  
  8. count% = 1                  ' initialize loop counter to 1
  9.           
  10. CLS                         ' display intro message and QUIT note
  11. PRINT "Enter party game ideas; type QUIT to stop"
  12. PRINT
  13.                             ' loop while count% is within array bounds
  14. DO WHILE (count% >= LBOUND(party$)) AND (count% <= UBOUND(party$))
  15.     INPUT "Party game:  ", party$(count%)      ' read input into array
  16.     IF (party$(count%) = "QUIT") THEN EXIT DO  ' if user types QUIT,
  17.     count% = count% + 1                        '   then exit loop
  18. LOOP
  19.  
  20. PRINT
  21. PRINT "You entered the following games:"
  22. PRINT
  23.  
  24. FOR i% = 1 TO count% - 1    ' print array contents
  25.     PRINT party$(i%)        ' count% - 1 contains last value entered
  26. NEXT i%
  27.  
  28.